<template>
  <div>
    <el-breadcrumb separator="/">
      <el-breadcrumb-item :to="{path:'/'}">首页</el-breadcrumb-item>
      <el-breadcrumb-item v-for="(item) in routeList" :key="item.index">
        <a :to="{ path: item.path }">{{item.name}}</a>
      </el-breadcrumb-item>
    </el-breadcrumb>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        routeList: ''
      }
    },

    created() {
      this.getRoutePath()
    },
    methods: {
      getRoutePath() {
        this.routeList = this.$route.meta.routeList;
        console.log(this.routeList)
      }
    },
    beforeRouteEnter(to, from, next) {
      console.log(to.meta.routeList)
      next(vm => {
        vm.routeList = to.meta.routeList
      })
    },

  }

</script>

<style scoped>


</style>
